<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Shan-P2P平台</title>
		<#include "common/links-tpl.ftl" />
		<link type="text/css" rel="stylesheet" href="/css/account.css" />
		<script type="text/javascript" src="/js/plugins/jquery.twbsPagination.min.js"></script>
		<script type="text/javascript" src="/js/plugins-override.js"></script>
		<script type="text/javascript" src="/js/My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript">
		 	$(function(){
		 		
		 		// 显示日期控件
		 		$(".beginTime,.endTime").click(function(){
		 			WdatePicker();
		 		});
		 		
		 		$("#query").click(function(){
		 			$("#pageNum").val(1); //重新查询的时候设置当前页为1
		 			$("#searchForm").submit();
		 		});
		 		
		 		$("#pagination").twbsPagination({
		 			totalPages: ${queryObject.pageCount},
		 			startPage: ${queryObject.pageNum},
		 			visiblePages: 7,
		 			hideOnlyOnePage: true,
		 			first: "<<",
		 			prev: "<",
		 			next: ">",
		 			last: ">>",
		 			onPageClick: function (evt, page) {
		 	           $("#pageNum").val(page);
		 	           $("#searchForm").submit();
		 	        }
		 		});
		 	});
		
		</script>
	</head>
	<body>
	
		<!-- 网页顶部导航 -->
		<#include "common/head-tpl.ftl" />
		<!-- 网页导航 -->
		<#assign currentNav="personal"/>
		<#include "common/navbar-tpl.ftl" />
		
		<div class="container">
			<div class="row">
				<!--导航菜单-->
				<div class="col-sm-3">
					<#assign currentMenu="ipLog" />
					<#include "common/leftmenu-tpl.ftl" />		
				</div>
				<!-- 功能页面 -->
				<div class="col-sm-9">
					<!-- 日志的高级查询 -->
					<form action="/log.do" name="searchForm" id="searchForm" class="form-inline" method="post">
						<input type="hidden" id="pageNum" name="pageNum" value="" />
						<div class="form-group">
							<label>时间范围</label>
							<input type="text" class="form-control beginTime" name="beginTime" value='${(queryObject.beginTime?string("yyyy-MM-dd"))!""}'/>
						</div>
						<div class="form-group">
							<label></label>
							<input type="text" class="form-control endTime" name="endTime" value='${(queryObject.endTime?string("yyyy-MM-dd"))!""}'/>
						</div>
						<div class="form-group">
							<button type="button" id="query" class="btn btn-success"><i class="icon-search"></i> 查询</button>
						</div>
					</form>
					<hr>
					<hr>
					<!-- 日志列表 -->
					<div class="panel panel-default" style="margin-top: 20px;">
						<div class="panel-heading">
							登录日志
						</div>
						<table class="table table-striped">
							<thead>
								<tr>
									<th>用户</th>
									<th>登录时间</th>
									<th>登录ip</th>
									<th>登录状态</th>
								</tr>
							</thead>
							<tbody>
								<#list logs as log>
									<tr>
										<td>${log.username}</td>
										<td>${log.loginTime?string("yyyy-MM-dd HH:mm:ss")}</td>
								        <td>${log.loginIp}</td>
								        <td>${log.result}</td>
									</tr>
								</#list>
							</tbody>
						</table> 	
						<div style="text-align: center;">
							<ul id="pagination" class="pagination"></ul>
						</div>
					</div>
				</div>
			</div>
		</div>		
						
		<#include "common/footer-tpl.ftl" />
	</body>
</html>